/**
 * 
 */
package br.com.cept.sce.commons.util;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
/**
 * @author Junier Amorim
 *
 */
public class DAOManager {
	
	private static EntityManagerFactory emf;

	public static EntityManager getEntityManager() {
		if (emf == null){
			emf = Persistence.createEntityManagerFactory("cept");
		}
		EntityManager em = emf.createEntityManager();
		return em;
	}
		
	public static void fechar(){
		emf.close();
	}

}

